package com.zzw.spring.aop.advice;

import java.lang.reflect.Method;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.aop.MethodBeforeAdvice;

//前置通知
public class GreetingBeforeAdvice implements MethodBeforeAdvice{

	private Logger logger = LoggerFactory.getLogger(getClass());

	@Override
	public void before(Method method, Object[] args, Object obj) throws Throwable {
		logger.info(obj.getClass().getName() + "." + method.getName());
		String name = (String) args[0];
		System.out.println("How are you!" + name);
	}

}
